package com.tsmti.core.quartz.factory;

import com.tsmti.core.quartz.data.ScheduleJob;
import com.tsmti.core.quartz.utils.TaskUtils;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @Package：com.tsmti.core.quartz.factory
 * @Class：QuartzJobFactory
 * @Description： TODO
 * @Author：zcw
 * @Date：Created in 2018/5/15 22:46
 * @Company:
 * @Version：
 * @Modified By:
 */
public class QuartzJobFactory implements Job {
    public final Logger log = Logger.getLogger(this.getClass());

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
        TaskUtils.invokMethod(scheduleJob);
    }
}
